<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>链接</title>
    <script src="public/jQuery/jQuery-2.1.3.min.js"></script>
    <script src="public/js/publicjs.js"></script>
    <style>
        .block{
            height: 50vh;
            width: 100%;
            display: flex;
            text-align: center;
            font-size: 3vh;
            line-height: 50vh;
        }
        .block_xs_6{
            flex: 1;

        }
        .showbottom{
            border-bottom: 1px solid black;
        }
        .showleft_right{
            border-left: 1px solid black;
            border-bottom: 1px solid black;
            border-right: 1px solid black;
        }

    </style>
</head>
<body>
   <div class="block">
       <div class="block_xs_6 showbottom">
           <a href="approval/html/index.html">审批</a>
       </div>
       <div class="block_xs_6 showleft_right">
          <a href="log/logHtml/index.html">日志</a>
       </div>
       <div class="block_xs_6 showbottom">
          <a href="task/index.html">Tower任务</a>
       </div>
   </div>
   <div class="block">
       <div class="block_xs_6">
          <a href="vote/html/voteHome.html"> 微投票</a>
       </div>
       <div class="block_xs_6 showleft_right">
           <a href="questionnaire/index2.html">问卷</a>
       </div>
       <div class="block_xs_6">
         <a href="manageCalendars/calendar.html"> 管理日历 </a>
       </div>
   </div>
</body>
</html>
<script>

    $(function(){
        var data = {
            "name": "13811112222",
            "passwd": "1234567"
        };
//        var token,user_id,user_name,team_id='{3F5DBA7A-515B-4848-913C-A80F0B2BEB34}';
        var token,user_id,user_name,deptName,
                team_id=
//                        '{170E35E5-2DBF-4BF5-9491-18BF48FF06AF}';
//                        '{B4235AEA-FBB4-4377-8B95-9531368FA926}'; //有管理员权限组
//                        '{5F612985-5230-4389-8C5C-CEF6E16CA1D1}';
//        '{71E0FAD9-2047-4CE5-B9A4-AF530F74AFBB}';
'{5F612985-5230-4389-8C5C-CEF6E16CA1D1}';
        //登入接口--天宽(跨域问题)
//                        '{5F612985-5230-4389-8C5C-CEF6E16CA1D1}';

        //$.ajax({
        //    async: true,
        //    crossDomain: true,
        //    url: "http://127.0.0.1:3106/platform/login",
        //    method: "POST",
        //    data:JSON.stringify(data),
        //    type:"POST",
        //    headers: {
        //        "remote-addr": "0:0:0:0:0:0:0:",
        //        "content-type": "application/json",
        //        "cache-control": "no-cache"
        //    },
        //    jsonpCallback:"jsoncallback",
        //    success:function(d){
        //
        //
        //    },
        //    beforeSend:function(){
        //
        //    },
        //    error:function(d){
        //
        //    }
        //});

        //node 代理
        $.ajax({
            async: true,
            crossDomain: true,
            url: tk_apiurl+"platform/login",
            method: "POST",
            data:data,
            jsonpCallback:"jsoncallback",
            dataType: "jsonp",
            success:function(d){

                var data=data_analysis(d);
                var data1 = data.result;

                token=data1.token;
                user_id=data1.id;
                user_name=data1.name;
                deptName = escape(data1.dep.deptName);


            },
            beforeSend:function(){

            },
            error:function(d){

            }
        });

        $('a').on('click', function(event) {
            event.preventDefault();
           var href = $(this).attr('href');
            if(user_id==undefined){
                user_id=1;
            }
            if(token==undefined){
                token=1;
            }
            if(user_name==undefined){
                user_name="";
            }
            user_name = escape(user_name);
            window.location.href=encodeURI(href+'?token='+token+'&userId='+user_id+'&user_name='+user_name+'&team_id='+team_id+'&imToken=1'+'&qyxBindId=1&'+'role=3&deptName='+deptName+'');
        });
    })
</script>